package com.example.springbootdemo.aop;


import org.aopalliance.intercept.Joinpoint;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.Signature;
import org.aspectj.lang.annotation.*;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.stereotype.Component;

import java.util.concurrent.Executor;


@Aspect
public class MyAspect {

    //@After("")
    @Pointcut("execution(* com.example.springbootdemo.aop.MyMathServes.*(..))")
    public void pointcut() {}


    @Before("pointcut()")
    public void start(JoinPoint joinPoint){
        final Object[] args = joinPoint.getArgs();
        final Signature signature = joinPoint.getSignature();
        System.out.println("我先执行。。。。");
    }

    @After("pointcut()")
    public void after(JoinPoint joinPoint){

    }

    @AfterReturning(value = "pointcut()",returning = "a")
    public void end(JoinPoint joinPoint,Object a){

    }

    @AfterThrowing(value = "pointcut()",throwing = "executor")
    public void threadDeath(JoinPoint joinPoint,Executor executor) {

    }



}
